'use strict';

const Controller = require('egg').Controller;

class H5ActiveController extends Controller {
    async getH5ActiveList() {
        const {
            ctx,
            service
        } = this;
        const options = ctx.request.body;
        const result = await service.admin.h5Active.getH5ActiveList(options);
        const redisUserInfo = await this.app.redis.get('redis_key');
        ctx.response.success({
            result,
            redisUserInfo
        });
        const des = `【${ctx.curAdminUser.realName}】在【${ctx.getDate_YYYY_MM_DD_HH_mm_ss()}】查询新用户分享领取红包列表【${JSON.stringify(options)}】`;
        ctx.writeSysOperationLogs('查询新用户分享领取红包列表', ctx.getSystemLogType('QUERY'), {
            curAdminUser: ctx.curAdminUser,
            des
        });
    }
    async getH5ActiveCaculate() {
        const {
            ctx,
            service
        } = this;
        const options = ctx.request.body;
        const result = await service.admin.h5Active.getH5ActiveCaculate(options);
        ctx.response.success(result);
        const des = `【${ctx.curAdminUser.realName}】在【${ctx.getDate_YYYY_MM_DD_HH_mm_ss()}】查询新用户统计领取红包列表【${JSON.stringify(options)}】`;
        ctx.writeSysOperationLogs('查询新用户统计领取红包列表', ctx.getSystemLogType('QUERY'), {
            curAdminUser: ctx.curAdminUser,
            des
        });
    }
}

module.exports = H5ActiveController;